<template>
    <div class="components-container">
      
        <div class="header-form">
          <div class="layui-inline" >
              <label class="layui-form-label">物品名称</label>
              <div class="layui-inline">
              <el-input  v-model="selectData.DpgnameEquals" placeholder="请输入物品名称" @keydown.enter.native="btnSearch"></el-input>
              </div>
          </div>
          <el-button type="primary" @click="btnSearch" :loading="this.$store.state.isloading">搜索</el-button>
          <el-button  @click="btnRepeat" >重置</el-button>
        </div>
        
        <div style="height:56px">
            <ul class="toolList">
                <li><el-button type="primary" @click="btnSearch" :loading="this.$store.state.isloading">刷新</el-button></li>
                <li v-if="btnShow(item.BTNVALUE)" v-for="(item, index) in $store.state.btnListCommon" @click="operate(item.BTNVALUE)">
                  <el-button type="primary" :value="item.BTNSHOWNAME" v-text="item.BTNSHOWNAME"></el-button>
                </li>
            </ul>
        </div>
        <dataTable :headList="headList" :dataList="dataList" :pageOrder="pageOrder" :hiddenColumn="hiddenColumn" @pageChange="pageChange" @selectRow="selectRow"></dataTable>
      
       <printmodal ref="printPdf"></printmodal>
        <outLibraryMain ref="dialog" @refreshData="getData"></outLibraryMain>
    </div>
</template>

<style rel="stylesheet/scss" lang="scss" scoped>
@import "src/styles/common.scss";
.el-button + .el-button {
  margin-left: 0;
}
.btnCenter {
  text-align: center;
}
</style>
<script>
import sweetModal from "@/components/sweetModal";
import dataTable from "@/components/Table/DataTable";
import apiBase from "@/api/apiBase.js";
import outLibraryMain from "./outLibraryMain";
import { formatDate, timeStringToDate } from "@/utils/date.js";
import { manage } from "@/mixins/managePage.js";
import { DATESELECTMODE } from "@/const/const.js";
import { ORDER } from "@/const/orderConst.js";
import { PRINT } from "@/components/Pdf/PDF.js";
import printmodal from "@/components/Pdf/Print";
import informationRegistrationVue from '../jointPlatform/informationRegistration.vue';


const OPEN = "开放";

export default {
  name: "arehousingManage",
  mixins: [manage],
  data() {
    return {
      DateSelectMode: DATESELECTMODE,
      //查询条件
      selectData: {
        DpgnameEquals: null,
      },
      //收费信息
      chdData: {},
      //付款方式
      payment: [],
      CHDCODNAME: null,
      chlList: [],
      hiddenColumn: false,
    };
  },
  methods: {

    //获取收费信息
    getData() {
      let selectData = JSON.parse(JSON.stringify(this.selectData));
      // if (!this.selectData.RegbussnumLike) {
      //   selectData.RegbussnumLike = null;
      // }
      let data = {
        PageIndex: this.pageOrder.currentPage,
        PageSize: this.pageOrder.pageSize,
        OrderBy: this.pageOrder.orderType,
        OrderByType: this.pageOrder.orderSort,
        Data: selectData
      };
      apiBase.DoService(data, apiBase.getApiAdress().Depot.QueryStockWarning, res => {
        this.dataList = res.data.content.OutData;
        this.pageOrder.totalNum = res.data.content.RecordCount;
        this.dataList.forEach(data => {
          data.REGDATE = data.REGDATE.substring(0, 16);
        });
      });
    },
    //获取表头
    getheaderlist(){
      let data = {};
      apiBase.DoService(
        data,
        apiBase.getApiAdress().Column.GetStockWarningColumns,
        res => {
          this.headList = res.data.content;
        }
      )
    },
    //功能操作
    operate(order) {
    //   this.order = order;
    //   switch (this.order) {
    //     case APPLY:
    //       this.$refs.dialog.open(this.order);
    //       break;
    //     default:
    //   }
    },
   
   
   
   
   
    //查询条件重置
    btnRepeat() {
      this.selectData = {};
      this.getData();
    },
    dataRepeat() {
      this.chdData = {};
    },
    //按钮显隐
    btnShow(btn) {
      // if(btn === OPEN) return true;
    },
   
  },
  components: {
    sweetModal,
    dataTable,
    printmodal,
    outLibraryMain
  },
  activated() {
    this.getData();
  },
  mounted() {
  },
  created() {
    this.getheaderlist();
  },
  watch: {
    
  }
};
</script>

